/*
 * @Description: storage class -> local static; This points out a difference in initialization: fade is initialized each time trystat() is called, but stay is initialized just once
 * @Version: 1.0
 * @Author: marshal
 * @Date: 2022-06-23 09:07:39
 * @LastEditors: marshal
 * @LastEditTime: 2022-06-23 09:12:54
 */
#include <stdio.h>

/**
 * @brief 测试local static variable
 *
 */
void trystat(void);

int main(int argc, char const *argv[])
{
    int count;
    for (count = 1; count <= 3; count++)
    {
        printf("Here comes iteration:%d\n", count);
        trystat();
    }
    return 0;
}

void trystat(void)
{
    int fade = 1;
    static int stay = 1;
    printf("fade = %d and stay = %d\n", fade++, stay++);
}
